<?php

class User extends AppModel{
    var $name = 'User';
    var $hasOne = 'Invite';
	var $hasMany = array(
		'Blog' => 
		array(
			'className' => 'Blog',
			'foreignKey' => 'user_id'
		)
	
	); 
		
    var $validate = array(
        'first_name'=> array(
            'rule' => 'notEmpty',
            'message' => 'This field cannot be left blank.'
        ),        
        'last_name' => array(
            'rule' => 'notEmpty',
            'message' => 'This field cannot be left blank.'
        ),
        'passwd' => array(
            'rule' => 'notEmpty',
            'message' => 'This field cannot be left blank.'
        ),        
        'email_addr' => array(
            'emailAddrRule1' => array(
                'rule' => 'email',
                'message' => 'Please supply a valid email address.'
            ),
            'emailAddrRule2' => array(
                'rule' => 'isUnique',
                'message' => 'This email already exists in our database.'
            )
        ),
        'postal' => array(
            'rule' => array('postal', null, 'us'),
            'allowEmpty' => true,
            'message' => 'Please enter a valid postal code.'
        ),        
        'phone' => array(
            'rule' => array('phone', null, 'us'),
            'message' => 'Please enter valid Phone Number.'
        )
    );
}

?>
